#include <concepts>
#include <type_traits>

// 1. 简单类型判断
template <typename T>
concept Tiny = sizeof(T) <= 2;

// 2. 多类型组合
template <typename T>
concept Integral = std::is_integral_v<T>;

template <typename T>
concept SignedIntegral = Integral<T> && std::is_signed_v<T>;

// 3. 要求存在某成员函数
template <typename T>
concept Drawable = requires(T t) {
    t.draw(); // 必须能调用 .draw()
};

// 4. 要求某运算符存在
template <typename T>
concept Equality = requires(T a, T b) {
    { a == b } -> std::convertible_to<bool>;
    { a != b } -> std::convertible_to<bool>;
};

// 5. 变参 concept：所有类型都满足 P
template <typename... Ts>
concept AllTiny = (Tiny<Ts> && ...); // C++17 fold expression

// 6. 结合继承关系
class Shape
{
};
class Circle : public Shape
{
};

template <typename T>
concept ShapeType = std::derived_from<T, Shape>;